package com.mryang.hds.configs;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * @author Genius
 * @version 1.0.0
 * @ClassName InterceptorConfig.java
 * @Description TODO 全局拦截器
 * @createTime 2022年12月25日 19:43:00
 */

@Configuration
public class InterceptorConfig  implements WebMvcConfigurer {
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration inter =
                registry.addInterceptor(new TokenInterceptor());
        inter.addPathPatterns("/api/**");
        inter.excludePathPatterns("/api/login");
        inter.excludePathPatterns("/api/register");
        inter.excludePathPatterns("/api/upload");
    }
}
